package com.demo.aop.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.demo.aop.service.Calculator;

@RestController
@RequestMapping("/aop")
public class AopController {

	@Autowired
	private Calculator calculator;

	@RequestMapping(value = "/login", method = RequestMethod.GET)
	public String login(Integer i, Integer j, HttpServletRequest request) {
		int add = calculator.add(i, j);
		int min = calculator.min(i, j);
		Long l = calculator.testPointCut(i, j);
		request.setAttribute("result", add + ":" + min + ":" + l);
		return "index";

	}

}
